Release 10.1A: OpenEdge Development:
Progress 4GL Reference


CURRENT-RESULT-ROW function

Returns the number of the current row of a specified query.

Syntax

CURRENT-RESULT-ROW ( query-name ) 

query-name

A character expression that evaluates to the name of a currently open, scrolling query. If query-name does not resolve to the name of a query, or if the query is not open or not scrolling, then the function returns the Unknown value (?).

Note: Searching for a query using a handle is more efficient than a character expression. Progress resolves a character expression at runtime by searching in the current routine for a static query with that name. If not found, Progress searches the enclosing main procedure. If still not found, Progress searches up through the calling programs of the current routine, and their main procedures. Since a handle uniquely identifies a query, no such search is required. Use the query object handle’s CURRENT-RESULT-ROW attribute to avoid a runtime search.

Examples

The following example uses the QUERY-OFF-END function to determine when to leave the REPEAT loop:

r-resrow.p
DEFINE QUERY cust-query FOR customer SCROLLING.
OPEN QUERY cust-query FOR EACH customer WHERE Country = "USA".

REPEAT:
    GET NEXT cust-query.
    IF QUERY-OFF-END("cust-query") THEN LEAVE.
    DISPLAY CURRENT-RESULT-ROW("cust-query") LABEL "Result Row" 
        Cust-num Name.
END. 

Notes

See also

CLOSE QUERY statement, CURRENT-RESULT-ROW attribute, DEFINE BROWSE statement,DEFINE QUERY statement, GET statement, NUM-RESULTS function, OPEN QUERY statement, REPOSITION statement


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095